<!DOCTYPE html>
<html>
<head>
<title>考 试</title>
<meta charset="utf-8" >
<meta name="renderer" content="webkit">
<meta name="author" content="XYB" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="format-detection" content="telphone=no, email=no"/>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="viewport" content="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no">
<link rel="stylesheet" href="../../static/css/bootstrap.min.css">
<link rel="stylesheet" href="../../static/css/paging.min.css">
<link rel="stylesheet" href="../../static/css/init.css">
<link rel="stylesheet" href="../../static/css/common.css">
<link rel="icon" href="../../static/images/favicon.ico" type="image/x-icon">
<style>
.exam-area{
	padding:10px 10px 120px 10px;
}
.exam-tables{
	width:96%;
	margin-left:auto;
	margin-right:auto;
	border:1px solid #333;
}
.exam-tables thead tr{
	background: #d9edf7;
}
.exam-tables tr{
	border-top:1px solid #333;
}
.exam-tables tr td{
	text-align: center;
	height:45px;
	line-height:45px;
	font-size:14px;

}
.exam-tables tr td:nth-child(1),
.exam-tables tr td:nth-child(3){
	width:15%;
}
.exam-tables tr td:nth-child(2),
.exam-tables tr td:nth-child(4){
	width:35%;
}
.exam-tables tbody tr:nth-child(even){
	background:#d7d7d7;
}
.exam-tables tr td:nth-child(2){
	border-left:1px solid #333;
	border-right:1px solid #333;
}
.exam-tables tr td:nth-child(4){
	border-left:1px solid #333;
}
</style>
</head>
<body>
    <header id="header" class="relative full-x"></header>
    <div class="allwarp relative">
        <div class="main-Content">
            <div class="common-cont exam-area mt-20 full-x bg-fff rad-3">
            	<table class="exam-tables">
            		<thead><tr><td>Id</td><td>标题</td><td>状态</td><td>考试时间</td></tr></thead>
					<tbody id="ListTables"></tbody>
				</table> 
				<div class="paging-area-box mt-10 magin-auto">
					<div class="paging-area float-left" id="pagination"></div>
					<span class="pageNum float-right f-14">共<em>0</em>条数据</span>
				</div>
				
            </div>
        </div>
    </div>
    <footer id="footer" class="full-x f-14 c-666 text-center"></footer>
</body>
<script src="../../static/js/util/jquery-1.9.1.min.js"></script>
<script src="../../static/js/util/bootstrap.min.js"></script>
<script src="../../static/js/util/jquery.paging.min.js"></script>
<script src="../../static/js/commonJS/interface.js"></script>
<script src="../../static/js/commonJS/common.js"></script>
<script>
    function tableListFun(pageNo){
            var id = window.document.getElementById("ListTables");

            $.ajax({
                url: get_examLlist_interface+'?currentPage='+pageNo,
                type:'post',
                dataType:'json',
                xhrFields:{
                    withCredentials:true
                },
                crossDomain:true,
                data:{
                    currentPage:pageNo
                },
                success: function(data) {
                    if(data.code==200){
                        innerTbody(data,id, tableListFun);
                    }else{
                        $.message(data.msg);
                    }
                },
                error: function (error) {
                    $.message("链接超时，请刷新...");
                }
            });
        }
        tableListFun(1);
        function innerTbody(data,id, func){
            var page = data.data.num;
            var currentPage = data.data.currentPage;
		    var tml = "";

		    $(".pageNum em").html(page);
		    if(page>0){
		        setPagination(page,currentPage, func);
		        var lists = data.data.list;
		        $('#pagination').show();
		        for (x in lists) {
		        	tml += "<tr>"+
						"<td>"+lists[x]["exam_id"]+"</td>"+
		                "<td>"+lists[x]["exam_name"]+"</td>"+
		                "<td>"+lists[x]["state"]+"</td>"+
                        "<td>"+lists[x]["start_time"]+" — "+lists[x]["end_time"]+"</td>"+
		        	"</tr>" ;
		        }
		    }else{
		        $('#pagination').hide();
		    }
		    id.innerHTML = tml;
        }
</script>
</html>